package com.example.sangong.controller;

import com.example.sangong.http.Result;
import com.example.sangong.myannotation.SysLog;
import com.example.sangong.req.Req;
import com.example.sangong.req.menu.MenuListQueryReq;
import com.example.sangong.service.SgMenuService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/menu")
@Api(tags = "日志")
public class SysMenuController {
    @Resource
    private SgMenuService sgMenuService;

    @PostMapping("/getMenuList")
    @SysLog("查询菜单列表")
    public Result getMenuList(@RequestBody Req<MenuListQueryReq> req) {
        return Result.success(sgMenuService.getMenuList(req.getReq()));

    }

}
